from django.db import models
from django.utils import timezone


# Create your models here.


class Users(models.Model):
    id = models.AutoField(primary_key=True)
    user_name = models.CharField(max_length=20, db_index=True)
    password = models.CharField(max_length=20)
    add_time = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = 'users'
        verbose_name = 'users'
        verbose_name_plural = verbose_name


class Dirs(models.Model):
    id = models.AutoField(primary_key=True)
    user_name = models.CharField(max_length=20, db_index=True)
    dir = models.CharField(max_length=50, unique=True)
    add_time = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = 'dirs'
        verbose_name = 'dirs'
        verbose_name_plural = verbose_name
